/* add node on the list of directly mapped areas, make sure the
* list remains sorted.
*/
- //dmmap = (direct_mmap_node_t *)kmalloc(sizeof(direct_mmap_node_t), GFP_KERNEL);
dmmap = (direct_mmap_node_t *)kmalloc(KMALLOC_SIZE, GFP_KERNEL);
dmmap->vm_start = addr;
dmmap->vm_end = addr + size;
entry = find_direct(¤t->mm->context.direct_list, addr);
if(entry != ¤t->mm->context.direct_list){
list_add_tail(&dmmap->list, entry);
+ printk(KERN_ALERT "bd240 debug: added node %lx in the middle\n", node->vm_start);
} else {
list_add(&dmmap->list, ¤t->mm->context.direct_list);
+ printk(KERN_ALERT "bd240 debug: added node %lx at tail\n", node->vm_start);
}
/* and perform the mapping */
for ( curr = direct_list->next; curr != direct_list; curr = curr->next )
{
node = list_entry(curr, direct_mmap_node_t, list);
- if( node->vm_start >= addr ) break;
+ if( node->vm_start >= addr ){
+ printk(KERN_ALERT "bd240 debug: find_direct: hit %lx\n", node->vm_start);
+ break;
+ }
}
return curr;